<?php
/*session_start();
if(!isset($_SESSION['auth'])){

header("Location: AutogatorBuyer.html");
die(); 
}*/
 	require_once 'fetchInfo.php';
 	require_once '../services/config/connection.php';
	require_once '../services/model/dao/vo/VehicleVO.php';
	require_once '../services/model/dao/vo/MessageVO.php';
	
	$vehicle_key = $_GET["id"];
	$vehicleVO = new VehicleVO();
	$_instance = new FetchInfo();
	
	$vehicleVO = $_instance->getVehicleByVehicleID($vehicle_key);
	$accepted_price = '';
	
	
 	//if (((strtolower($vehicleVO->i_want_to)== "donate my vehicle")&& $vehicleVO->bid_price==0)||((strtolower($vehicleVO->i_want_to)== "donate my vehicle")&& $vehicleVO->bid_price!=0)) 	{
 		//$accepted_price = "Donate";
 	///}
 	//else if ((strtolower($vehicleVO->i_want_to)!= "donate my vehicle")&& $vehicleVO->bid_price==0)  	{
 		//$accepted_price = "Contact Buyer";
 	//}
 	//else 	{
 		//$accepted_price = $vehicleVO->bid_price;
 	//}
	if (strtolower($vehicleVO->i_want_to)== "donate my vehicle") {
 		$accepted_price = "Donate";
 	}else {
 		if($vehicleVO->accepted_price!=0){
 			$accepted_price = $vehicleVO->accepted_price;
 		}else {
 			$accepted_price = 'Contact Buyer';
 		}
 	}
$phone ='';
	$phone =  preg_replace('/\d{3}/', '$0-', str_replace('-', null, trim($vehicleVO->phone)), 2);
	
	$cell_phone = '';
	$cell_phone =  preg_replace('/\d{3}/', '$0-', str_replace('-', null, trim($vehicleVO->cell_phone)), 2);
?> 
<table width="100%" border="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Seller Pickup Receipt</title>
<style type="text/css">
#page_border {
	border: thin solid #666;
}
.large_font {
	font-size: 40px;
	color: #000;
}
body,td,th {
	font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
	font-size: 20px;
}
.small_red_font {
	font-size: 18px;
	color: #F00;
}
.fill_in_border {
	border-bottom-width: thin;
	border-bottom-style: solid;
	border-bottom-color: #000;
}
</style></head>

<body>
<table width="1100" border="0" align="center">
  <tr>
    <td id="page_border">
      <table width="100%" border="0" cellpadding="5">
        <tr> 
          <td width="3%">&nbsp;</td>
          <td width="22%"><img src="http://www.autogator.com/images/autogator_logo.gif" width="200" height="114" /></td>
          <td width="50%"> 
            <div align="center"><font size="6"><b>Vehicle Pick Up Receipt</b></font><br>
              <font color="#FF0000" size="4">**Important Document, Please keep 
              for your records**</font></div>
          </td>
          <td width="25%" align="center" valign="middle" class="large_font" style="font-size: 30px"> 
            <p><font face="Arial, Helvetica, sans-serif"><b>800-838-8878</b></font></p>
            <p><font face="Arial, Helvetica, sans-serif" color="#006600">autogator.com</font></p>
          </td>
        </tr>
        <tr> 
          <td colspan="4" align="center" class="small_red_font"> 
            <hr size="1" noshade>
          </td>
        </tr>
        <tr> 
          <td colspan="4" align="center" height="16">&nbsp;</td>
        </tr>
        <tr> 
          <td colspan="4" align="center"> 
            <table width="90%" border="0">
              <tr> 
                <td>AutoGator would like to thank you for the opportunity to purchase 
                  your vehicle. This receipt documents that AutoGator has taken 
                  possession of your 
                  <?php echo $vehicleVO->year?>
                  <?php echo $vehicleVO->make?>
                  <?php echo $vehicleVO->model?>
                  on the date shown below. Please keep this receipt for your personal 
                  records. If you need access to the vehicle after it has been 
                  picked up, please contact AutoGator within 24 hours. AutoGator 
                  will not be responsible for any personal items left in the vehicle.</td>
              </tr>
            </table>
          </td>
        </tr>
        <tr> 
          <td colspan="4" align="center">&nbsp;</td>
        </tr>
        <tr> 
          <td colspan="4" align="center" height="922"> 
            <table width="90%" border="0">
              <tr> 
                <td width="23%" style="font-weight: bold">Vehicle Information:</td>
                <td width="30%">&nbsp;</td>
                <td width="4%">&nbsp;</td>
                <td colspan="2"><b>Pick Up Information:</b></td>
              </tr>
              <tr> 
                <td width="23%">Year:</td>
                <td width="30%"> 
                  <?php echo $vehicleVO->year?>
                </td>
                <td width="4%">&nbsp; </td>
                <td width="21%">Name:</td>
                <td width="22%">
                  <?php echo $vehicleVO->first_name?>
                </td>
              </tr>
              <tr> 
                <td width="23%">Make:</td>
                <td width="30%"> 
                  <?php echo $vehicleVO->make?>
                </td>
                <td width="4%">&nbsp; </td>
                <td width="21%">Address: </td>
                <td width="22%">
                  <?php echo $vehicleVO->street_address?>
                </td>
              </tr>
              <tr> 
                <td width="23%">Model:</td>
                <td width="30%"> 
                  <?php echo $vehicleVO->model?>
                </td>
                <td width="4%">&nbsp; </td>
                <td width="21%">City:</td>
                <td width="22%">
                  <?php echo $vehicleVO->city?>
                </td>
              </tr>
              <tr> 
                <td width="23%">Vin#</td>
                <td width="30%"> 
                  <?php echo $vehicleVO->vin?>
                </td>
                <td width="4%">&nbsp; </td>
                <td>State, Zip Code:</td>
                <td>
                  <?php echo $vehicleVO->state?>
                  , 
                  <?php echo $vehicleVO->zip?>
                </td>
              </tr>
              <tr> 
                <td width="23%">Plate#</td>
                <td width="30%">&nbsp;</td>
                <td width="4%">&nbsp;</td>
                <td colspan="2">&nbsp;</td>
              </tr>
              <tr> 
                <td width="23%">Documents Provided:</td>
                <td width="30%"> 
                  <?php echo $vehicleVO->paper_work?>
                </td>
                <td width="4%">&nbsp; </td>
                <td colspan="2">Price: 
                  <?php echo $vehicleVO->accepted_price?>
                </td>
              </tr>
            </table>
            <br>
            <table width="90%" border="0">
              <tr> 
                <td colspan="2" style="font-weight: bold">Vehicle Received By:</td>
              </tr>
              <tr> 
                <td height="28" width="15%">Name:</td>
                <td class="fill_in_border" width="85%">&nbsp;</td>
              </tr>
              <tr> 
                <td height="39" width="15%">Signature:</td>
                <td class="fill_in_border" width="85%">&nbsp;</td>
              </tr>
            </table>
            <br>
            <table width="90%" border="0">
              <tr> 
                <td height="31" width="15%">Pickup Date:</td>
                <td class="fill_in_border" width="41%">&nbsp;</td>
                <td width="10%">Time:</td>
                <td class="fill_in_border" width="34%">&nbsp;</td>
              </tr>
            </table>
            <br>
            <hr size="1" noshade width="100%">
            <div align="right"> 
              <table width="980" border="0" align="center">
                <tr> 
                  <td><img src="images/release-note.jpg" width="980" height="100"></td>
                </tr>
              </table>
              <hr size="1" noshade>
              <table width="980" border="0" align="center">
                <tr>
                  <td><img src="images/receipt-splash.jpg" width="980" height="420"></td>
                </tr>
              </table>
            </div>
            </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>